$(warning $(shell java -version))

JAVA_VERSION = $(HOME)/java.version
JAVA_1 = $(shell java -version | sed 's/.*\"//g')
#JAVA_2 := $(shell echo ${JAVA_1} | sed 's/.*\"//g')
#JAVA_3 := $(shell echo $(JAVA_2) | sed 's/\".*$//g')

JAVA_HOME:=/usr/lib/jvm/java-openjdk


java.out:
	echo $(JAVA_1)
	yum -y install java-1.8.0-openjdk-devel.x86_64
	echo "export JAVA_HOME=$(JAVA_HOME)" >> /etc/profile
	echo "export PATH="'$$'"PATH:"'$$'"JAVA_HOME/bin" >> /etc/profile
	echo "export CLASSPATH=.:"'$$'"JAVA_HOME/lib/dt.jar:"'$$'"JAVA_HOME/lib/tools.jar" >> /etc/profile
	. /etc/profile
	java -version
	touch $@

